/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package towersofhanoi;

/**
 *
 * @author k00104663
 */
public class TowersOfHanoi {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Move(4,1,3,2);
        
         int N = 128;
        moves(N, true);
    }
    
    public static void Move(int count, int start,int finish,int temp){
        if(count>1){
            Move(count-1,start,temp,finish);
            System.out.println("Move disk from "+start+" to "+finish);
            Move(count-1,temp,finish,start);
        }
        else System.out.println("Move a disk from "+start+" To "+finish);       
    }
    
  
    public static void moves(int n, boolean left) {
        if (n == 0) return;
        moves(n-1, !left);
        if (left) System.out.println(n + " left");
        else      System.out.println(n + " right");
        moves(n-1, !left);
    }

    

}

